import Vue from 'vue'
import VueRouter from 'vue-router'
import Vant from 'vant';
import 'vant/lib/index.css';

Vue.use(Vant);

Vue.use(VueRouter)

const routes = [
    // 重定向
    {
      path:'/',
      redirect:'/home'
    },
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/Home.vue'),
  },
  {
    path: '/tixing',
    name: 'tixing',
    component: () => import('../views/Tixing.vue'),
  },

  {
    path: '/clock',
    name: 'clock',
    component: () => import('../views/Clock.vue'),
  },
  {
    path: '/dynamic',
    name: 'dynamic',
    component: () => import('../views/Dynamic.vue'),
    meta:{
      keepAlive:true 
    }
  },
  {
    path: '/record',
    name: 'record',
    component: () => import('../views/Record.vue'),
  },

  {
    path: '/mine',
    name: 'mine',
    component: () => import('../views/Mine.vue'),
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/Login.vue'),
  },
  {
    path: '/setting',
    name: 'setting',
    component: () => import('../views/Setting.vue'),
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/Register.vue'),
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
